<@override name="main">
<div class="box">
    <form id="search-form" accept-charset="UTF-8" action="<@s.url '/search?pagesize=15'/>" method="get">
        <div style="margin:0;padding:0;display:inline"></div>
        <label class="hidden-for-sighted" for="search-input"><@s.message 'fulltext.fields'/></label>

        <p>
            <input id="search-input" name="q" size="60" type="text" art="textbox" value="${q}">
            <label><input id="titles_only" name="titles_only" <#if only_title>checked="checked" </#if> type="checkbox"
                          value="1"><@s.message 'fulltext.only.title'/></label>
            <label><@s.message 'fulltext.all.fields'/></label>

        </p>
	<#--<p>-->
	<#--<label><input checked="checked" id="issues" name="issues" type="checkbox" value="1"> 问题</label>-->
	<#--</p>-->
        <p>
            <input id="search-submit" icon="search" art="button" text="<@s.message 'operation.submit'/>">
            <input id=back_buttion icon="undo" art="button" text="<@s.message 'operation.return'/><@s.message 'home.layout.menu.item.1'/>">
    </form>
</div>

<div id="search-results-counts">
    <ul>
	<#--<li><a href="/search?issues=1&amp;q=aa">问题 (${count})</a></li>-->
    </ul>
</div>

<h3><@s.message 'fulltext.result'/> (${count})</h3>
<dl id="search-results">
	<#list documents as doc>
        <dt class="issue">
            <span class="project">${doc.pname}</span> <a href="<@s.url '/issue/view/${doc.pkey}'/>">${doc.pkey}: ${doc.summary}</a>
        </dt>
        <dd>
		<#--<span class="description">${doc.summary}</span>-->
            <span class="author">${doc.created?string("yyyy-MM-dd HH:mm:ss")}</span>
        </dd>
	</#list>

    <p></p>

    <div style="text-align: center;">
		<#if hasPre>
            <a href="<@s.url '/search?q=${q}&pageindex=${previous}&pagesize=15'/>">« <@s.message 'fulltext.page_pre'/></a> &nbsp;
            <a href="<@s.url '/search?q=${q}&pageindex=1&pagesize=15'/>"><@s.message 'fulltext.page_first'/></a> &nbsp;
		</#if>
		<#if hasNext>
            <a href="<@s.url '/search?q=${q}&pageindex=${next}&pagesize=15'/>"><@s.message 'fulltext.page_next'/> »</a>
		</#if>
    </div>
    <p></p>

    <div style="clear:both;"></div>
</@override>
<@override name="scripts">
    <script type="text/javascript">
        $(document).ready(function () {
            var s_input = $('#search-input');
            s_input.focus();
            s_input.bind('keyup', function (env) {
                if (event.keyCode == 13) {
                    $('#search-form').submit();
                }
            });
            $('#search-submit').button().event('click', function () {
                $('#search-form').submit();
            });

            $('#back_buttion').click(function () {
                location.href = system_vars.basePath;
            });

        })
    </script>
</@override>
<@extends name="/common/layout.ftl" title="operation.search"></@extends>